<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Device485Attr extends Model
{
    use HasFactory, SoftDeletes;

    protected $table = 'device_485_model_attr';

    protected $fillable = ['pid', 'name', 'start_address', 'register_num', 'unit', 'formula', 'byte_num'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function deviceModel()
    {
        return $this->belongsTo(Device485Model::class, 'pid');
    }
}
